package com.httpDemo.doMain;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import lombok.Data;

/**
 * application为前缀的配置文件中的值自动注入到了ioc容器中， 使用@Value注解可获取到容器中的值。
 * 
 * @author Administrator
 *
 */
@Component
@Data
public class Person2 {

	@Value("${person.id}")
	private Integer id;
	@Value("${employee.name}")
	private String name;
	@Value("${employee.user-name}")
	private String userName;
	@Value("${random.int(10,50)}")
	private Integer age;
	private String[] hobby;
	private List<String> lists;
	private Map<String, String> maps;
	private Set<String> sets;
	@Value("${person.birth}")
	private Date birth;

}
